home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mrcry204.zip / LSQRFIT.EKA < prev    next >
Text File  |  1991-03-04  |  582b  |  21 lines

  1. ; This example demonstrates the ability to find
  2. ; values for constants in a function that make the
  3. ; function best fit empirical data.  Because the equation
  4. ; file includes a LEVEL 0 statement, Mercury will
  5. ; perform a Least Squares Fit to find the function (of
  6. ; the required form) that best matches the points (x, f(x)) given.
  7.  
  8. ; In this example, the function is
  9. ;    f(x) := EXP(a * x^N + B)
  10. ; where the ideal solution is close to a = 0.25, b = 0.15 and N = 1.5.
  11.  
  12. f(x) := EXP(A x^N + B)
  13.  
  14. f(1) = 1.49
  15. f(2) = 2.35
  16. f(3) = 4.26
  17. f(4) = 8.59
  18. f(5) = 19.01
  19.  
  20. LEVEL 1
  21.